package rozetka;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;

import rozetka.driver.DriverFactory;

public class PrePostConditions {
	public WebDriver driver;

	@BeforeMethod
	public void initiateConnection() throws Exception {
		String browser = System.getProperty("browser");
		driver = DriverFactory.getDriver(browser);
		driver.get("http://rozetka.com.ua/");
		driver.manage().timeouts().implicitlyWait(7, TimeUnit.SECONDS);
	}

	@AfterMethod
	public void closeConnection() throws Exception {
		driver.quit();
	}

}
